﻿using GalaSoft.MvvmLight.Messaging;

namespace SimpleChat
{
    public class UserListMessage : MessageBase
    {
        public enum MessageType
        {
            Add,
            Remove,
            Clear
        }

        public MessageType Type { get; set; }
        public int Id { get; set; }
        public string Username { get; set; }

        public UserListMessage(MessageType type, int id, string username)
        {
            Type = type;
            Id = id;
            Username = username;
        }

        public override bool Equals(object obj)
        {
            var ulm = obj as UserListMessage;
            return ulm != null ? Id.Equals(ulm.Id) : base.Equals(obj);
        }
    }
}
